import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_example/pages/list_detail/index.dart';

class HomeView extends StatelessWidget {
  const HomeView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("首页"),
      ),
      body: ListView(
        children: [
          // 路由&导航
          ListTile(
            title: const Text("导航-命名路由 home > list"),
            subtitle: const Text('Get.toNamed("/home/list")'),
            onTap: () => Get.toNamed("/home/list"),
          ),
          ListTile(
            title: const Text("导航-命名路由 home > list > detail"),
            subtitle: const Text('Get.toNamed("/home/list/detail")'),
            onTap: () => Get.toNamed("/home/list/detail"),
          ),
          ListTile(
            title: const Text("导航-类对象"),
            subtitle: const Text("Get.to(DetailView())"),
            onTap: () => Get.to(const DetailView()),
          ),
          const Divider(),
        ],
      ),
    );
  }
}
